Command processing device and method for processing command

ABSTRACT

A command processing device includes a first command storing circuit which stores a command and a decode circuit which decodes the command from the first command storing circuit and which outputs a decoded command and a control signal. The device also includes a command generating circuit which receives the command from the first command storing circuit, which generates a command in response to the control signal, and which outputs generated command to the decode circuit.

BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention

[0002] The present invention generally relates to a command processing device that performs a predetermined processing based on a command stored in a memory device. The present invention also relates to a method for processing a command.

[0003] This application is counterpart of Japanese patent applications, Serial Number 39802/2000, filed Feb. 14, 2000, the subject matter of which is incorporated herein by reference.

[0004] 2. Description of the Related Art

[0005] In a command processing device, one command is processed by two or more following states. First, a command code (it is called hereinafter command) is fetched from an external memory device, such as ROM. Next, the command is decoded. Then, the decoded command is executed. In a state by which the command is executed, a write-in operation of the command to a command register etc. is contained. There is a technology that improves a performance of the command processing device performing the above state. The technology is referred to as a command fetch pipeline processing (it is called a pipeline processing hereinafter). In the pipeline processing, a plurality of commands are divided into the states, thus the commands are processed in parallel. According to the pipeline processing, it is possible to shorten the time required in order to perform a program.

[0006] One example of the conventional command processing device 300, which performs the above mentioned pipeline processing, is explained with referring to FIG. 18. One command in this command processing device 300 is processed by passing through a state (IF state) in which a command is fetched, a state (ID state) in which the fetched command is decoded, and a state (EX state) in which the decoded command is executed and written in a register. In addition, the command which the above three states comprised of and ends within one machine cycle is referred to as the minimum execution cycle command.

[0007] As shown in FIG. 18, the command processing device 300 is made up of an IF state part 310, an ID state part 320, and an EX state part 330.

[0008] The IF state part 310 includes a memory device 311, a control device 312 which designates an address location in the memory device 311, an incrementor 313, a selector 314 which is connected to the incrementor 313 and an Arithmetic and Logic Unit 331 (it is called ALU hereinafter) explained later and which selects either an output of the ALU 331 or an output of the incrementor 313, and a command storing register 315.

[0009] The ID state part 320 include a command decoder 321 which is comprised of a logic circuit and which decodes an execution command stored in the command storing register 315, a register file 322 which stores an operation result and the object (it is also called an operand) of operation, a RAM 323 which stores an operation result and an operand, a selector 324 which selects either an output of the register file 322 or an output of the RAM 323, a storing register 325 which stores an operand to be performed, and an address register 326 which feeds back an output of the storing register 325 to the RAM 323. The command decoder 321 outputs a control signal for executing a command to the register file 322 and the address register 326.

[0010] The EX state part 330 is constituted by the ALU 331. The ALU 331 inputs a command and an operand from the storing register (not illustrated) in the ID state part 320 and performs a predetermined operation. Then, the ALU 331 outputs the operation result to the register file 322 and the RAM 323 in the II) state part 320 and controls the selector 314 in the IF state part 310.

[0011] As mentioned above, each state of the command is processed by the corresponding structure element in the command processing device 300. According to the above structure, while one state under one command is performed, another state under another command can be performed. That is, it is enabled to perform pipeline processing.

[0012]FIG. 19 is a timing chart showing a processing time when the pipeline processing with respect to commands 1 through 4, wherein each of the commands is the minimum execution cycle command, are executed. For example, at the processing time t, the EX state of the command 1, the ID state of the command 2, and the IF state of the command 3 are simultaneously performed. As mentioned above, by dividing commands into states, parallel processing of two or more commands can be carried out. Thus, commands are processed in parallel. According to the pipeline processing, it is possible to shorten the whole processing time.

[0013] By the way, in order to shorten the whole processing time in the above mentioned pipeline processing, the time of each state needs to be made as short as possible and equal. That is, when one state is very long compared with another state, the whole processing time depends on the processing time of the one state. As a result, the original purpose of shortening the time required for executing a program can not be obtained.

[0014] As architecture of the command processing device generally used, there are RISC (Reduced Instruction Set Computer) and CISC (Complex Instruction Set Computer). These have the following features. That is, in RISC, while there is an advantage that command decoding time and command execution time are short because each command is simple, there is a disadvantage that command read out time is long.

[0015] In CICS, although there is an advantage that command read out time is short because CISC includes the complicated command decoding mechanism, there is a disadvantage that command decoding time and command execution time are long. Thus, from the viewpoint of equalization of the processing time of each state, neither RISC nor CISC is suitable architecture. Consequently, there has been a need for a new architecture having each advantage.

SUMMARY OF THE INVENTION

[0016] It is an object of the present invention is to provide a command processing device that can execute a command efficiently.

[0017] It is still another object of the present invention is to provide a command processing device having a simplified structure.

[0018] It is still another object of the present invention is to provide a command processing device having a smaller circuit area.

[0019] It is still another object of the present invention is to provide a method for processing command that can improve a processing time.

[0020] According to one aspect of the present invention, for achieving one or more of the above objects, there is provided a command processing device that includes

[0021] a first command storing circuit which stores a command and a decode circuit which decodes the command from the first command storing circuit and which outputs a decoded command and a control signal. The device also includes a command generating circuit which receives the command from the first command storing circuit, which generates a command in response to the control signal, and which outputs generated command to the decode circuit.

[0022] According to another aspect of the present invention, for achieving one or more of the above objects, there is provided a method for processing command that includes the following steps. That is, the method includes generating a first command composed of a plurality of bits; decoding the first command; executing a predetermined process based on the decoded first command; generating a second command by using the first command based on the decoded result of the first command; decoding the second command; and executing a predetermined process based on the decoded second command.

[0023] The above and further objects and novel features of the invention will more fully appear from the following detailed description, appended claims and the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

[0024]FIG. 1 is a block diagram showing a command processing device 100 according to a first preferred embodiment of the present invention.

[0025]FIG. 2 is a block diagram showing a command generating means 116 according to a first preferred embodiment of the present invention.

[0026]FIG. 3 is a figure explaining a command PUSH.

[0027]FIG. 4 is a figure showing the relationship between the contents of a first operand field 31 and selected register.

[0028]FIG. 5 is a table showing the relationship between the contents of a first operand field 31 and selected register.

[0029]FIG. 6 is a figure showing the relationship between the contents of a second operand field 32 and selected register.

[0030]FIG. 7 is a table explaining a command MOV and a command STORE.

[0031]FIG. 8 is a table explaining a command LOD.

[0032]FIG. 9 is a block diagram showing a command decoder 121 according to a first preferred embodiment of the present invention.

[0033]FIG. 10 is a table explaining a command processing flow according to a first preferred embodiment of the present invention.

[0034]FIG. 11 is a timing chart showing a processing time of command processing device 100.

[0035]FIG. 12 is a block diagram showing a command processing device 200 according to a second preferred embodiment of the present invention.

[0036]FIG. 13 is a block diagram showing a command generating means 216 according to a second preferred embodiment of the present invention.

[0037]FIG. 14 is a figure explaining a command PUSH.

[0038]FIG. 15 is a table explaining a command MV AR, RX, a command PUSH Rn, and a command LOD.

[0039]FIG. 16 is a table explaining a command processing flow according to a second preferred embodiment of the present invention.

[0040]FIG. 17 is a block diagram showing a command decoder 221 according to a second preferred embodiment of the present invention.

[0041]FIG. 18 is a block diagram showing a conventional command processing device 300.

[0042]FIG. 19 is a timing chart showing a processing time of command processing device 300.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0043] A command processing device according to preferred embodiments of the present invention will be explained hereinafter with reference to figures. In order to simplify explanation, like elements are given like or corresponding reference numerals through this specification and figures. Dual explanations of the same elements are avoided.

First Preferred Embodiment

[0044] The command processing device 100 according to a first preferred embodiment of the present invention is now explained with reference to FIG. 1.

[0045] The command processing device 100 is a device that performs the pipeline processing with respect to the minimum execution cycle command like the case of the above mentioned conventional technology The command processing device 100 includes an IF state part 110 which fetches a command, an ID state part 120 which decodes the fetched command, and an EX state part 130 which executes the decoded command and which performs writing operation to a register.

[0046] (IF State Part 110)

[0047] Like the IF state part 110 of the above-mentioned conventional command processing device 300, the IF state part 310 includes a memory device 111 which stores a command code, a control device 112 which identifies an address location in the memory device 111, an incrementor 113, a selector 114 which is connected to the incrementor 113 and an ALU 131 and which selects either an output of the ALU 113 or an output of the incrementor 113, and a command storing register 115. In this embodiment, the command code consists of 12 bits.

[0048] Furthermore, the IF state part 110 has a command generation means 116 which receives the command code read from the memory device 111 and the command code stored in the command storing register 115. The command generation means 116 generates a new command code according to the received command and feeds it back to the command storing decoder 115.

[0049] In this embodiment, the command generation means 116 generates such new command code under control of a command decoder 121 explained later. The command generated by this command generation means 116 is stored in the command storing register 115 as a command to be executed next. About the algorithm of the command generation by this command generation means 116 is explained later.

[0050] (Command Generation Means 116)

[0051] A command generation means 116 has selectors 116 s each of which corresponds to respective bits of a command code, as shown in FIG. 2. In order to simplify explanation, illustration of a part of selector 116 s is omitted. In addition, although FIG. 2 shows the case where a command code is 12 bits, it is also possible to constitute the command generation means 116 so that the command code of the predetermined numbers of bits can be suited.

[0052] Each selector 116 s receives a clear signal CLR, which clears the bit of the command code and is output from the command decoder 112, and an output data selection signal SEL output from the command decoder 121. Each selector 116 s also receives the command code i.e., a data DT1 stored in the address location at which the control device 111 now identifies, output from the memory device 121. Furthermore, each selector 116 s receives a data DT2 corresponding to each bit of the command storing register 115.

[0053] Each selector 116 s which constitutes the command generation means 116 outputs either the data DT1 read out from the memory device 111 or the data DT2 output from the command storing register 115 as a data DT3 in response to the state of a select signal SEL. When each selector 116 s receives the clear signal CLR, the selector 116 s outputs data “0” as the DT3 regardless of data DT1 and data DT2. Each data DT3 is output to corresponding bit of the command storing register 115.

[0054] (Command Storing Register 115)

[0055] The command storing register 115 comprises latch circuits for storing bits which constitute a command code. That is, the command storing register 115 has two or more latch circuits which input and latch data DT3. Each bit of the command storing register 115 is set to “1” or is reset “0” by the data DT3 output from the command generation means 116.

[0056] (ID State Part 120)

[0057] Like the ID state part 320 of the above mentioned conventional command processing device 300, the ID state part 120 has a command decoder 121 which consists of a logic circuit for decoding an execution command stored in the command storing register 115, and a register file 122 which stores an operation result and a data as the object (operand) of operation. The ID state part 120 further has a RAM 123 which stores an operation result and an operand, a selector 124 which selects and outputs either an output of the register file 122 or an output of the RAM 123, a storing register 125 which stores an operand to be performed, and an address register 126 which feeds the output of the storing register 125 back to the RAM 123.

[0058] Such command decoder 121 transfers a control signal for executing the command to the register file 122 and the address register 126. The command decoder 121 further transmits a control signal which indicates whether to generate another command from the decoded command in the ID state part 120 to the command generation means 116. This control signal is a demand for setting each bit of the command field 30 mentioned later to “1” or for resetting them to “0”. The structure of the command decoder 121 is suitably designed according to the kind of command stored in memory device 111. The detail structure of the command decoder 121 is explained later.

[0059] (EX State Part 130)

[0060] Like the EX state part 330 of the above mentioned conventional command processing device 300, the EX state part 130 is constituted by an ALU 131. The ALU131 inputs the command and the operand output from the command storing register 115 in the ID state part 120, and performs a predetermined operation. Then, the ALU131 outputs the operation result to the register file 122 and the RAM 123 in the ID state part 120, and controls the selector 114 in the IF state part 110.

[0061] An operation of the command processing device 100 is explained hereinafter. In this embodiment, an example where the following command stored in the memory device 111 is executed by using the command generation means 116 is explained. This command is called Command PUSH hereinafter.

[0062] PUSH R3,[SP+]

[0063] This command PUSH is performed by using two or more register files which the processor has. In detail, the command PUSH is a command for storing the contents of one register file (R3 register file) to the predetermined region in the memory device, wherein the predetermined region is identified by the contents of another register file (SP register file). Here, the register files, such as SP register file and R3 register file, are collectively indicated as a register file 122 in FIG. 1.

[0064] The command code showing the command PUSH is stored in the memory device 111. This command code consists of a total of 12 bits of the 4 bits command field 30, the 4 bits first operand field 31, and the 4 bits second operand field 32, as shown in FIG. 3. Although the width (the number of bits) of each field is arbitrary, the width of each field is explained as 4 bits in this embodiment. This command code stored in the memory device 111 has been transferred to the command storing register 115, and has already been stored in the command storing register 115.

[0065] Next, the first operand field 31, the second operand field 32, and the relationship between these operand field and the register file 122 are explained briefly.

[0066] The first operand field 31 is the field for specifying (or recognizing) whether which register file of register files in the processor is set as the object of operation. As shown in FIG. 4, each register file is assigned to each bit. In detail, the R3 register, the R2 register, the R1 register, and the R0 register are assigned in the order of the highest bit to the lowest bit. It means that the register file assigned to the bit set to 1 is an object of operation, and means that the register file assigned to the bit reset to 0 is not the object of operation.

[0067] Moreover, in consideration of case where register files are specified during one command, the priority is attached to each bit of the first operand field 31 as shown in FIG. 5. As shown in FIG. 5, when the highest bit of the first operand field 31 is set to 1, the R3 register is selected regardless of the value of other bits. When the highest bit of the first operand field 31 is set to 0 and the second bit from the highest bit is set to 1, the R2 register is selected regardless of the value of other bits. When the highest bit and the second bit from it of the first operand field 31 are set to 0 and the third bit from the highest bit is set to 1, the R1 register is selected regardless of the value of other bits. When the highest bit, the second and the third bits from it of the first operand field 31 are set to 0 and the lowest bit is set to 1, the R0 register is selected regardless of the value of other bits.

[0068] As mentioned above, the selection of the register with the highest priority is judged in the position of the bit set to 1 in the first operand field 31. Here, the mark x in FIG. 5 means that the command decoder 121 does not refer to the contents of the first operand field 31.

[0069] The command decoder 121 selects the register file corresponding to the bit with the highest priority, and outputs this information to the EX state part 130 as the register for operation. Furthermore, the command decoder 121 gives the demand which clears the bit with the highest priority in the bits to which 1 are set in the first operand field 31 to the command generation means 116. That is, the demand which deletes the register file information output to the EX state part 130 from the first operand field 31 is given to the command generation means 116.

[0070] The command generation means 116 performs set or reset of the bit in which the command field 31 is specified in response to the demand of the command decoder 121. Thereby, the register file used as the object of operation can be changed. For example, the contents of the first operand field 31 assume that it is 1010. In this case, the R3 register with the higher priority is selected first. Then, when the clear demand is given to the command generation means 116, the next selected register file is changed to the R1 register. It is possible to change selection of the register from the register file with higher priority to the register file with lower priority dynamically, while executing the same command. As shown in FIG. 6, a plurality of register files are assigned to corresponding bits of the operand field 32 like the first operand field 31.

[0071] In order to perform the command PUSH, a command MOV, a command STORE, and a command LOD are sequentially executed. The command MOV, the command STORE, and the command LOD are explained with reference to FIG. 7 and FIG. 8. The command MOV and the command STORE in the command processing device 100 are distinguished by the value of the command field 30 as shown in FIG. 7. The command LOD in the command processing device 100 is distinguished by the value of the command field 30 and the value of the first operand field 31 as shown in FIG. 8.

[0072] The command MOV is a command that is executed when the value of the command field 30 is 1111. The command MOV performs the following operation.

[0073] (Operation 1)

[0074] The contents of the register file (SP) identified by the second operand field 32 are transferred to the address register 126.

[0075] (Operation 2)

[0076] A demand that the lowest bit of the command field 30 is cleared to 0 is issued to the command generation means 116. The demand of clearing the lowest bit of the command field 30 to 0 changes the value of the command field 30 to 1110 from 1111. When 1110 of the command field 30 is set to the 9th through the 12th bit of the command storing register 115 through the command generation means 116, the command next executed will change from the command MOV to the command STORE. That is, performing the demand which clears the lowest bit of the command field 30 to 0 means that the following command is changed from the command MOV to the command STORE.

[0077] The Command STORE is a command that is executed when the value of the command field 30 is 1110. The command STORE performs the following operation.

[0078] (Operation 1)

[0079] The contents of the register with the highest priority (the R3 register in this example) among the register files selected in the first operand field 31 as the register for operation are transferred to the specific address location in the memory device 111, wherein the specific address location is specified by the address register 126.

[0080] (Operation 2)

[0081] The clear demand of the bit (the highest bit of the first operand field 31 in this example) to which the register with the highest priority (the R3 register in this example) is assigned is issued to the command generation means 116, wherein the register with the highest priority is among the register files selected as the register for operation in the first operand field 31.

[0082] (Operation 3)

[0083] +1 increment of the contents of the address register 126 is carried out.

[0084] While the command decoder 121 transfers the control signal for executing the command to latter the EX state part 130, it transfers a control signal which determines whether to generate another command code from the command code to the command generation means 116. This control signal is set/reset demand to each bit of the command field 30. The command generation means 116 performs set/reset of the command field 30 in response to the demand of the command decoder 121. An example of the structure of the command decoder 121 which performs such operation is explained with reference to FIG. 9.

[0085] (Command Decoder 121)

[0086] The command decoder 121 is made up of a command judgment circuit 121 a which judges the value of the command field 30, a command judging circuit 121 b, and a register selection circuit 121 c for the highest priority, as shown in FIG. 9. The value of the command field 30 is inputted into the command judgment circuit 121 a. When the value of the command field 30 is 1111, the command judgment circuit 121 a outputs a control signal MOV for executing the command MOV shown in FIG. 7, respectively to the register file 122 (SP register), the address register 126, and the command generation means 116.

[0087] Moreover, when the value of the command field 30 is 1110, the command judgment circuit 121 a outputs a signal indicating this information to the command judging circuit 121 b. The value of the first operand field 31 is further inputted into the command judging circuit 121 b. When the value of the command field 30 is 1110 and the value of the first operand field 31 is 0000, the command judging circuit 121 b outputs a control signal LOD for executing the command LOD shown in FIG. 8 to the address register 126 and the command generation means 116, respectively.

[0088] When the value of the command field is 1110 and the value of the first operand field 31 is not 0000, the command judging circuit 121 b outputs a signal indicating this information to the register selection circuit 121 c. The register selection circuit 121 c outputs a control signal STORE for performing the command STORE shown in FIG. 7 to the address register 126 and the command generation means 116, respectively.

[0089] Next, the actual flow of processing a command is explained with reference to FIG. 10. The 12 bits command code read from the memory device is first stored in the command storing register 115 through the command generation means 116. The command code stored in the command storing register 115 is decoded by the command decoder 121 in the ID state part 110 as the command MOV Then, the EX state part 130 executes the command MOV. At this time, the command decoder 121 outputs the control signal (clear signal CLR) for clearing the lowest bit of the command field 30 to 0 to the command generation means 116. The command generation means 116 sets corresponding outputs DT3 of selector 116 s to 0 in response to the clear signal CLR. In addition, the command generation means 116 has received the output of the command storing register 115. Therefore, the bit which should not be cleared among the outputs DT2 of the command storing register 115 is transferred to the command storing register 115 as the output DT3 in response to the output data selection signal SEL. As a result, only the corresponding bit in the command storing register 115 is cleared to 0. That is, it means that the command code is rewritten into the command STORE. The above operation is performed, without reading a new command from the memory device 111. (State 1)

[0090] Next, the rewritten command code stored in the command storing register 115 is decoded by the command decoder 121 as the command STORE. Then, the EX state part 130 performs the command STORE. At this time, the command decoder 121 outputs the control signal (clear signal CLR) for clearing the highest bit of the first operand field 31 to 0 to the command generation means 116. The command generation means 116 resets the corresponding output DT3 of the selector 116 s to 0 in response to the clear signal CLR. In addition, the command generation means 116 has received the output of the command storing register 115. Therefore, the bit which should not be cleared among the outputs DT2 of the command storing register 115 is transferred to the command storing register 115 as an output DT3 in response to the output data selection signal SEL. As a result, only the corresponding bit of the command storing register 115 is cleared to 0. That is, it means that the command code is rewritten into the command LOD. It performs also without reading a new command from the memory device 111. (State 2)

[0091] Next, the rewritten command code stored in the command storing register 115 is decoded by the command decoder 121 as the command LOD. Then, the EX state part 130 executes the command LOD. At this time, the command decoder 121 notifies that the command PUSH is completed to the command generating means 116 and also demands the command generation means 116 to read a new command from the memory device 111 specified by the control device 112. After this demand, each sector 116 s selects DT1 in response to the output data selection signal SEL. (State 3)

[0092] Since the command LOD performs a read out demand of a new execution command from the memory device 111, the above command processing using the command generation means 116 completes with an end of the command LOD.

[0093]FIG. 11 is a timing chart showing the processing time of the command pipeline processing at the time of performing the complex command code in the command processing device 100. In this embodiment, the command code read from memory device 111 is a command code compounded with two or more commands whose bit length do not change. For this reason, the number of times of read out of the command stored in memory device 111 decreases as shown in FIG. 11. This means that the processing speed of a command does not depend on the read out time of a command from the memory device. Consequently, the command processing can be performed efficiently.

[0094] Like RISC command, the complex command code is processed in a state that the bit length of its is fixed. Therefore, the complicated mechanism like when decoding a command of a variable length command set is not needed. For this reason, according to this embodiment, circuit area and cost can be reduced.

[0095] Furthermore, a means for generating the following command can be obtained by using a relatively simple logic circuit, without using the local memory such as a cache memory having a high-speed interface function. Therefore, according to this embodiment, circuit area can be reduced.

Second Preferred Embodiment

[0096] The command processing device 200 is a device which modifies the first preferred embodiment. A command generation means 216, a command storing register 215, and a command decoder 221 of the second preferred embodiment are replaced with the command generation means 116, the command storing register 115, and the command decoder 121, respectively.

[0097] Since other structure elements of the command processing device 200 are the substantially the same as that of the first preferred embodiment, explanations as to the other structure elements are omitted.

[0098] (Command Generation Means 216)

[0099] The command generation means 216 generates a new command code under control of the command decoder 221 explained later. The command generated by this command generation means 216 is stored in the command storing register 215 as a command next executed. An algorithm of the command generation by this command generation means 216 is explained later.

[0100] The command generation means 216 has selectors 216 s (including a selector 216S-2, a selector 216S-3, and a selector 216S-4) each of which corresponds to respective bits of a command code, as shown in FIG. 13. In order to simplify explanation, illustration of a part of selector 216 s is omitted. Moreover, the selector 216S-3 and the selector 216S-4 consist of 4 bits. FIG. 13 shows a case where a command code is 16 bits.

[0101] Each selector 216 s except for the selector 216 s-2 receives a clear signal CLR, which clears the bit of the command code output from the command decoder 221, and an output data selection signal SEL output from the command decoder 221. The selector 216 s-2 receives a clear signal CLR, which clears the bit of the command code output from a comparison circuit 216 b, and the output data selection signal SEL output from the command decoder 221.

[0102] Each selector 116 s further receives the command code, i.e., a data DT1 stored in the address location at which the control device 112 now identifies, output from the memory device 111. Each selector 216 s also receives a data DT2 corresponding to each bit of the command storing register 215.

[0103] Each selector 216 s which constitutes the command generation means 216 outputs either the data DT1 read from the memory device 111 or the data DT2 output from the command storing register 215 as a data DT3 in response to the state of a select signal. When each selector 216 s receives the clear signal CLR, the selector 216 s outputs data “0” as the data DT3 regardless of the data DT1 and the data DT2. Each data DT3 is output to corresponding bit of the command storing register 215.

[0104] The command generation means 216 also includes an adder circuit 216 a consisted of 4 bit and a comparison circuit 216 b consisted of 4 bits. The adder circuit 216 a receives 4 bits data from n field of the command storing register 215 and a count up enable signal CE output from the command decoder 221. An output of the adder circuit 216 a is transferred to the comparison circuit 216 b and the selector 216 s-3. An output of the selector 216 s-3 is inputted into the n field of the command storing register 215.

[0105] The comparison circuit 216 b receives the output of the adder circuit 216 a and 4 bits data from m field of the command storing register 215. The comparison circuit 216 b judges whether an condition m<n is satisfied. When this condition is satisfied, the comparison circuit 216 b outputs the clear signal CLR to the selector 216 s-2.

[0106] According to such structure, a plurality of commands can be continuously executed by fetching the command at one time. For example, the data writing to the register files (R0, R1, R2, . . . ) or successive address locations in the memory device can be performed. (Command storing register 215) The command storing register 215 comprises latch circuits for storing bits which constitute a command code. That is, the command storing register 215 has two or more latch circuits which input and latch data DT3. Each bit of the command storing register 215 is set to “1” or is reset “0” by the data DT3 output from the command generation means 216.

[0107] (Command Decoder 221)

[0108] The command decoder 221 transfers a control signal for executing the command to the register file 122 and the address register 126. The command decoder 221 further transfers a control signal which indicates whether to generate another command from the decoded command in the ID state part 120 to the command generation means 216. This control signal is a request for setting each bit of the command field 70 mentioned later to “1” or for resetting them to “0”. The structure of the command decoder 221 is suitably designed according to the kind of command stored in the memory device 111. The detail structure of the command decoder 221 is explained with reference to FIG. 17.

[0109] An operation of the command processing device 200 is explained below. In this embodiment, an example where the following command stored in the memory device 111 is executed by using the command generation means 216 is explained. This command is called comand PUSH hereinafter.

[0110] PUSH Rn-Rm

[0111] It is noted that the command PUSH of this embodiment is different from the command PUSH of the first preferred embodiment.

[0112] This command PUSH Rn-Rm is a command for storing from the contents of the register file identified by the n field to the contents of the register file identified by the m field into the RAM 123 which is accessed by the contents of the register file identified by the field 71.

[0113] The structure of each field is shown in FIG. 14. As shown in FIG. 14, the command field is made up of the field 70, the n field, the field 71, and the m field. Each field consists of 4 bits. The n field shows the execution start number of the command, and the m field shows the execution end number of the command. The contents of the n field and the m field function as an address for specifying a register file.

[0114] In order to perform the command PUSH Rn-Rm, a command MOV AR, Rx, a command PUSH Rn, and a command LOD are sequentially executed. The command MOV AR, Rx, the command PUSH Rn, and the command LOD are explained with reference to FIG. 15. The command MOV AR, Rx, the command PUSH Rn, and the command LOD are distinguished by the value of the command field 70 as shown in FIG. 15.

[0115] The command MOV AR, Rx is a command executed when the value of the command field 70 is 1111. The command MOV AR, Rx performs the following operation.

[0116] (Operation 1)

[0117] The contents of the register file identified by the field 71 are transferred to the address register 126.

[0118] (Operation 2)

[0119] A request that the lowest bit of the command field 70 is cleared to 0 is issued to the command generation means 216. The request of clearing the lowest bit of the command field 70 to 0 changes the value of the command field 70 to 1110 from 1111. When 1110 of the command field 70 is set to the 13th through the 16th bit of the command storing register 215 through the command generation means 216, the command next executed will change from the command MOV AR, RX to the command PUSH Rn. That is, performing the request which clears the lowest bit of the command field 70 to 0 means that the following command is changed from the command MOVAR, RX to the command PUSH Rn.

[0120] The Command PUSH Rn is a command that is executed when the value of the command field 70 is 1110. The command PUSH Rn performs the following operation.

[0121] (Operation 1)

[0122] The contents of a register file identified by the n field are transferred to the specific address location of the memory device 111 by which the address register 126 identified.

[0123] (Operation 2)

[0124] Counting up request for counting up the value of the n field is issued against the command generation means 216.

[0125] The command LOD is a command that is executed when the value of the command field 70 is 1010. The command LOD performs the following operation.

[0126] (Operation 1)

[0127] The contents of the address register 126 are transferred to the register file identified by the field 71.

[0128] (Operation 2)

[0129] The request that the command generation means 216 fetches a new command from the memory device 111 specified by the control device 112 is issued to the command generation means 216. The notice that the command PUSH Rn-Rm is completed is issued to the command generation means 216.

[0130] Next, the structure of the command decoder 221 of this embodiment is explained with reference to FIG. 17.

[0131] (Command Decoder 221)

[0132] While the command decoder 221 transfers a control signal for executing the command the EX state part 130, it transfers a control signal which determines whether to generate another command code from the command code to the command generating means 216. This control signal is set/reset request against each bit of the command field 70.

[0133] As shown in FIG. 17, the command decoder 221 is made up of a command judging circuit 221 a which judges the value of the field 70, and a command judging circuit 221 b. The command judging circuit 221 a receives the value of the command field 70.

[0134] When the value of the command field 70 is 1111, the command judging circuit 221 a outputs a control signal MOV for exec -ting the command MOV AR, RX as shown in FIG. 15 to the register file 122, the address register 126, and the command generation means 216.

[0135] When the value of the field 70 is not 1111, the command judging circuit 221 a outputs this information to the command judging circuit 221 b. When the value of the field 70 is 1110, the command judging circuit 221 b outputs a control signal PUSH for performing the command PUSH Rn shown in FIG. 15.

[0136] When the value of the field 70 is 1010, the command judging circuit 221 b outputs a control signal LOD for executing the command LOD shown in FIG. 15.

[0137] Next, the actual flow for processing a command is explained with reference to FIG. 16. The 16 bits command code read from the memory device 111 is first stored in the command storing register 215 through the command generation means 216. The command code stored in the command storing register 115 is decoded by the command decoder 221 as the command MOV AR, RX. Then, the EX state part 130 executes the command MOV AR, RX. At this time, the command decoder 221 outputs the control signal (clear signal CLR) for clearing the lowest bit of the command field 70 to 0 to the command generation means 216. The command generation means 216 resets corresponding outputs DT3 of the selector 216 s to 0 in response to the clear signal CLR. In addition, the command generation means 216 has received the output of the command storing register 215. Therefore, the bit which should not be cleared among the outputs DT2 of the command storing register 215 is transferred to the command storing register 215 as the output DT3 in response to the output data selection signal SEL. As a result, only the corresponding bit in the command storing register 215 is cleared to 0. That is, it means that the command code is rewritten into the command PUSH. The above operation is performed without reading a new command from the memory device 111. (State 1)

[0138] Next, the rewritten command code stored in the command storing register 215 is decoded by the command decoder 221 as the command PUSH Rn. Then, the EX state part 130 performs the command PUSH Rn.

[0139] The adder circuit 216 a within the command generation means 216 has received 0001 of the n field. After performing command PUSH Rn, the adder circuit 216 a receives the count up enabel signal CE, and outputs 0010 to the selector 216 s-3. Therefore, the contents of the n field of the command storing register 215 are rewritten into 0010. The comparison circuit 216 b in the command generation means 216 holds 0010 of the m field. Since the output 0010 of adder circuit 216 a is not over 0010 in which the comparison circuit 216 b holds, the comparison circuit 216 b does not yet output the clear signal CLR.

[0140] Then, the command PUSH Rn+1 is performed in the EX state part 130 as well.

[0141] The adder circuit 216 a in the command generation means 216 has received 0010 of the n field. After performing the command PUSH Rn+1, the adder circuit 216 a receives the count up enable signal CE, and outputs 0011 to the selector 216 s-3. Therefore, the contents of the n field of the command storing register 215 are rewritten into 0011. Since the output 0011 of the adder circuit 216 a exceeds 0010 which the comparison circuit 216 b holds, the comparison circuit 216 b outputs the clear signal CLR to the selector 216 s-2. The above operation performs also without reading a new command from the memory device 111. (State 2)

[0142] The corresponding output DT3 of the selector 216 s-2 is reset to 0 in response to the clear signal CLR. The command generation means 216 has received the output of the command storing register 215. Therefore, the bit which should not be cleared among the outputs DT2 of the command storing register 215 is transferred to the command storing register 215 as the output DT3 in response to the output data selection signal SEL. As a result, only the corresponding bit of the command storing register 215 is cleared to 0. That is, it means that the command code is rewritten into the command LOD.

[0143] Next, the rewritten command code stored in the command storing register 215 is decoded by the command decoder 221 as the command LOD. Then, the EX state part 130 executes the command LOD. At this time, the command decoder 221 notifies that the command PUSH Rn-Rn+1 is completed to the command generating means 216 and also requests the command generation means 216 to read a new command from the memory device 111 specified by the control device 112. After this request, each sector 216 s selects DT1 in response to the output data selection signal SEL. The above operation performs also without reading a new command from the memory device 111. (State 3)

[0144] According to this embodiment, the following effects are expectable. That is, a plurality of commands can be sequentially executed by fetching the command at a time. For example, writing data into successive address locations of maximum 2n in the memory device, where n is number of bits of n field, can be performed. Therefore, the memory can be used efficiently when programming is executed.

[0145] Since it is possible to reduce the number of times which reads the command from the memory device according to this invention, the processing speed of the command does not depend on the read out time of the command from memory device For this reason, efficient command processing is possible.

[0146] Moreover, like RISC command, the complex command code is processed in a state that the bit length of its is fixed. Therefore, the complicated mechanism like when decoding a command of a variable length command set is not needed. For this reason, according to this embodiment, circuit area and cost can be reduced.

[0147] Furthermore, a means for generating the following command can be obtained by using a relatively simple logic circuit, without using the local memory such as a cache memory having a high-speed interface function. Therefore, according to this embodiment, circuit area can be reduced.

[0148] While the preferred form of the present invention has been described, it is to be understood that modifications will be apparent to those skilled in the art without departing from the spirit of the invention. The scope of the invention is to be determined solely by the following claims. 

What is claimed is:
 1. A command processing device comprising: a first command storing circuit which stores a command; a decode circuit which decodes the command from the first command storing circuit and which outputs a decoded command and a control signal; and a command generating circuit which receives the command from the first command storing circuit, which generates a command in response to the control signal, and which outputs generated command to the first command generating circuit.
 2. A command processing device as set forth claim 1 , further comprising: a second command storing circuit which stores a command, and wherein the command generating circuit receives the command from the second command storing circuit and outputs received command to the first command storing circuit.
 3. A command processing device as set forth claim 1 , wherein each command comprised of a plurality of bits.
 4. A command processing device as set forth claim 3 , wherein the command generating circuit includes selectors, each of which outputs either corresponding bit of the command from the first command storing circuit or corresponding bit of the command from the second command storing circuit in response to the control signal.
 5. A command processing device as set forth claim 4 , wherein each selector sets or resets corresponding bit according to the control signal, thereby the command output from the command generating circuit is changed.
 6. A command processing device as set forth claim 5 , wherein the control signal comprises a selection signal and a clear signal, wherein each selector transfers either the command from the first command storing circuit or the command from the second command storing circuit in response to the selection signal, and wherein each selector outputs data 0 or data 1 in response to the clear signal.
 7. A command processing device comprising: a first command storing circuit which stores a command; a decode circuit which decodes the command from the first command storing circuit and which outputs a decoded command and a control signal; and a command generating circuit which receives the command from the first command storing circuit and which generates a command from the received command of the first command storing circuit in response to the control signal.
 8. A command processing device as set forth claim 7 , further comprising: a second command storing circuit which stores a command, and wherein the command generating circuit receives the command from the second command storing circuit and outputs received command to the first command storing circuit.
 9. A command processing device as set forth claim 8 , wherein each command comprised of a plurality of bits, wherein the command generating circuit includes selectors each of which outputs either corresponding bit of the command from the first command storing circuit or corresponding bit of the command from the second command storing circuit in response to the control signal.
 10. A command processing device as set forth claim 9 , wherein each selector sets or resets corresponding bit according to the control signal, thereby the command output from the command generating circuit is changed.
 11. A command processing device as set forth claim 10 , wherein the control signal comprises a selection signal and a clear signal, wherein each selector transfers either the command from the first command storing circuit or the command from the second command storing circuit in response to the selection signal, and wherein each selector outputs data 0 or data 1 in response to the clear signal.
 12. A method for processing command comprising: generating a first command composed of a plurality of bits; decoding the first command; executing a predetermined process based on the decoded first command; generating a second command by using the first command based on the decoded result of the first command; decoding the second command; and executing a predetermined process based on the decoded second command.
 13. The method of claim 12 , wherein the generating the second command comprises: setting or resetting a predetermined bit of the first command to generate the second command. 